package com.gxa.community.admin.controller.order;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gxa.community.admin.service.order.UserInfoService;
import com.gxa.community.core.utils.R;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/order")
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;


    @ApiOperation("  ")
    @PostMapping("/queryuserinfodto")
    public String quertUserInfoDTO(Integer userId) throws JsonProcessingException {
        R r = userInfoService.queryUserInfoDTO(userId);
        ObjectMapper objectMapper = new ObjectMapper();
        String result = objectMapper.writeValueAsString(r);
        return result;
    }
}
